﻿using System.ComponentModel;
using System;
using System.Drawing;

namespace DevExpress.CrmDemo.Win.Data {
    public class GeneralStats : INotifyPropertyChanged {
        #region Public members

        public int YtdClosedCount {
            get { return _ytdClosedCount; }
            set {
                _ytdClosedCount = value;
                InvokePropertyChanged("YtdClosedCount");
            }
        }

        public decimal YtdPercentClosing {
            get { return _ytdPercentClosing; }
            set {
                _ytdPercentClosing = value;
                InvokePropertyChanged("YtdPercentClosing");
            }
        }

        public double AvgContractSize {
            get { return _avgContractSize; }
            set {
                _avgContractSize = value;
                InvokePropertyChanged("AvgContractSize");
            }
        }

        public double AvgTeamSize {
            get { return _avgTeamSize; }
            set {
                _avgTeamSize = value;
                InvokePropertyChanged("AvgTeamSize");
            }
        }

        public double AvgWeeks {
            get { return _avgWeeks; }
            set {
                _avgWeeks = value;
                InvokePropertyChanged("AvgWeeks");
            }
        }

        public int TeamMemberOpenOppsCount0 {
            get { return _teamMemberOpenOppsCount0; }
            set {
                _teamMemberOpenOppsCount0 = value;
                InvokePropertyChanged("TeamMemberOpenOppsCount0");
            }
        }

        public int TeamMemberOpenOppsCount1 {
            get { return _teamMemberOpenOppsCount1; }
            set {
                _teamMemberOpenOppsCount1 = value;
                InvokePropertyChanged("TeamMemberOpenOppsCount1");
            }
        }

        public int TeamMemberOpenOppsCount2 {
            get { return _teamMemberOpenOppsCount2; }
            set {
                _teamMemberOpenOppsCount2 = value;
                InvokePropertyChanged("TeamMemberOpenOppsCount2");
            }
        }

        public int TeamMemberOpenOppsCount3 {
            get { return _teamMemberOpenOppsCount3; }
            set {
                _teamMemberOpenOppsCount3 = value;
                InvokePropertyChanged("TeamMemberOpenOppsCount3");
            }
        }

        public int TeamMemberLeastOpenOppsId {
            get { return _teamMemberLeastOpenOppsId; }
            set {
                _teamMemberLeastOpenOppsId = value;
                InvokePropertyChanged("TeamMemberLeastOpenOppsId");
            }
        }

        #endregion

        #region INotifyPropertyChanged implementation
        public event PropertyChangedEventHandler PropertyChanged;

        private void InvokePropertyChanged(string name) {
            PropertyChangedEventHandler handler = PropertyChanged;
            if(handler != null) handler(this, new PropertyChangedEventArgs(name));
        }
        #endregion

        #region Private data
        private int _ytdClosedCount;
        private decimal _ytdPercentClosing;
        private double _avgContractSize;
        private double _avgTeamSize;
        private double _avgWeeks;
        private int _teamMemberOpenOppsCount0;
        private int _teamMemberOpenOppsCount1;
        private int _teamMemberOpenOppsCount2;
        private int _teamMemberOpenOppsCount3;
        private int _teamMemberLeastOpenOppsId;
        #endregion

    }
}
